package com.briup.pts.service.impl;

import com.briup.pts.mapper.QrcodeMapper;
import com.briup.pts.service.QrcodeService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class QrcodeServiceImpl implements QrcodeService {

    private final QrcodeMapper mapper;

    @Override
    public void addQrcode(String animalId, String url) {
        // 先删除对应的动物的二维码数据
        mapper.deleteByAnimalId(animalId);
        // 再新增数据
        mapper.insertQrcode(animalId,url);
    }
}
